<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="./inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="导航菜单" />
<%@ include file="./inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script language="javascript">
	function doLogout(){
		<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';DB_BACK;')!=-1}">
		parent.ShowConfirm('确认框','是否自动备份数据库？',340,80,"doLogoutBackup()");//doLogoutBackup是父窗口的
		</c:if>
		<c:if test="${currentUser.user.userType!=1 && fn:indexOf(currentUser.privs,';DB_BACK;')==-1}">
		window.top.location="/Logout.ihtm";
		</c:if>
	}
	function goDesktop(){
		window.parent.frames["mainFrame"].location="Desktop.ihtm";
	}
	function showStatus(){
		parent.window.status="时间：<fmt:formatDate value="${currentTime}" pattern="yyyy-MM-dd EEE"/>  当前操作员：${currentUser.staffer.stafferName}  使用单位：${licenseInfo.enterpriseName}";
	}
	/**
	function checkNewMessage(){
		var xmlHttp=createXMLHttpRequest();
		xmlHttp.open("GET", "/message/NewMessageCount.ihtm",true);
		xmlHttp.onreadystatechange = function(){callback(xmlHttp)};
		xmlHttp.send(null);
	}
	function checkNewMessageLoop(){
		checkNewMessage();
		setTimeout("checkNewMessageLoop()",1000*60*5);
	}
	function callback(xmlHttp){
    	if (xmlHttp.readyState == 4) {
      		if (xmlHttp.status == 200) {
      			if(xmlHttp.responseText!="0"){
      				document.getElementById("messageAlertTd").style.display="";
      			}else{
      				document.getElementById("messageAlertTd").style.display="none";
      			}
			}
		}
	}
	**/
	//function doTallySetChange(){
	//	var tsId=document.getElementById("default_ts_id").value;
	//	var xmlHttp=createXMLHttpRequest();
	//	xmlHttp.open("GET", "/system/UserTsChange.ihtm?ts_id="+tsId);
	//	xmlHttp.send(null);
	//}
	function showTsSelect(needTsSelect){
		if(needTsSelect!=null && needTsSelect=="Y"){
			var url="/system/UserTsSelect.ihtm";
			parent.ShowIframeNoScroll("选择当前帐套",url,300,200,"refreshTopWin()");//refreshTopWin是父窗口的
		}
	}
	function setDfTsSpan(str){//父窗口的refreshTopWin调用
		document.getElementById("df_ts_span").innerHTML=str;
	}
	function showTsPage(){
		setTimeout("showTsSelect('${currentUser.needTsSelect}');",1000);
	}
</script>
</head>
<c:set var="smsFlag" value="0" />
<c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';SMS_SEND_SIMP;')!=-1}"><c:set var="smsFlag" value="1" /></c:if>
<body oncontextmenu="return false" onLoad="showStatus();showTsPage();">
<div class="header">
  <div class="header-bg">
    <div class="logo">
      <div class="header-right-bg">
	        <div class="edit">	        	
					  <div class="company">		
					  	        <a class="select" style="cursor:pointer;color:#003399;" onClick="showTsSelect('Y');" title="点击切换当前的开单账套">
									<div>
										<p>
											<span id="df_ts_span">
											<c:if test="${currentUser.user.dfTsId==0}">请选开单帐套</c:if>
											<c:if test="${currentUser.user.dfTsId!=0}">${currentUser.dfTsName}</c:if>
											</span>
										</p>
									</div>
								</a>	
					  </div>
					  <ul class="edit-link">
					  	<li class="ico-out"><a href="javascript:doLogout();">退出</a></li>
						<c:if test="${smsFlag=='1'}"><li class="ico-sms"><a href="javascript:showWin(900,500,'/sms/SmsSendForm.ihtm');">发短信</a></li></c:if>
						<li class="ico-cal"><a href="javascript:showWin(900,600,'/base/EstablishmentCommunicateCalendar.ihtm');">&nbsp;日历</a></li>
						<li class="ico-notice"><a href="javascript:showWin(1024,600,'/bbs/Main.ihtm');">&nbsp;公告</a></li>
						<!--<li class="ico-help"><a href="javascript:showWin(1024,650,'/help.jsp');">帮助</a>-->
						<li class="ico-home" ><a href="javascript:goDesktop();">桌面</a>
					  </ul>
				</div>
				<ul class="menu-hot">
	          <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';BASE_CLIE;')!=-1}"><li><a href="javascript:showWin(1024,600,'/base/EstablishmentList.ihtm?type=CLIENT');" class="ico-client" title="管理全部客户档案">客户</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';BUSI_BILL_SEAR;')!=-1}"><li><a href="javascript:showWin(1280,800,'/business/BusinessBillSearchResult.ihtm');" class="ico-business" title="跟进业务单的状态，审核状态（未审核/已审核）、完工状态（未完工/已完工）、送货状态（未送货/已送货）、结清状态（未结清/已结清）。">业务一览</a></c:if></li>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';CLIE_PRIC;')!=-1}"><li><a href="javascript:showWin(1024,600,'/base/EstPriceList.ihtm?price_type=STA&est_type=CLIENT');" class="ico-price" title="项目标准价格表及固定客户的协议价格">价格</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';CLIE_UN_RECE;')!=-1}"><li><a href="javascript:showWin(1024,600,'/business/ReceivableList.ihtm');"  class="ico-accept" title="查询客户欠了多少钱">应收</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';UN_PAY_SEAR;')!=-1}"><li><a href="javascript:showWin(900,600,'/finance/PayableList.ihtm');" class="ico-paid" title="查询欠供应商与外协商多少钱">应付</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';BANK_COST;')!=-1}"><li><a href="javascript:showWin(1024,600,'/finance/AccountBalanceList.ihtm?is_tmp=Y');" class="ico-balance" title="查询资金账户上有多少钱">现金</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';STOC_SEAR;')!=-1}"><li><a href="javascript:showWin(900,600,'/storehouse/StockSearch.ihtm');" class="ico-stock" title="查询库存有多少材料，占用了多少资金">库存</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';PROF_COUN;')!=-1}"><li><a href="javascript:showWin(900,600,'/finance/ProfitCount.ihtm');"  class="ico-avail" title="查询收了多少钱、支出了多少钱，赚了多少钱">利润</a></li></c:if>
			  <c:if test="${currentUser.user.userType==1 || fn:indexOf(currentUser.privs,';BUSI_PROF;')!=-1}"><li><a href="javascript:showWin(1024,600,'/business/BusinessProfitSearchResult.ihtm');"  class="ico-profit" title="查询业务单的成本与毛利">成本</a></li></c:if>
	          <li style="background:none;">
	          	<a href="javascript:showWin(1024,600,'/message/Main.ihtm');" class="ico-info" title="发送消息给其他人，相当于内部电子邮件">消息<img src="/images/info-new.gif" id="messageAlertTd" style="margin:10px 0 10px 6px;display:none"/></a>
	          </li>
	       </ul>
      </div>
    </div>
  </div>
</div>
</body>
</html>
